package org.zjvis.datascience.common.vo.kg;

import cn.weiguangfu.swagger2.plus.annotation.ApiRequestExclude;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjvis.datascience.common.dto.kg.DataPushDTO;
import org.zjvis.datascience.common.dto.kg.KnowledgeGraphDTO;
import org.zjvis.datascience.common.util.DozerUtil;
import org.zjvis.datascience.common.vo.BaseVO;

import java.time.LocalDateTime;


/**
 * @description 知识图谱VO
 * @date 2022-03-28
 */
@Data
@NoArgsConstructor
public class KnowledgeGraphVO extends BaseVO {

    private Long id;

    private Long userId;

    private Long projectId;

    private String name;

    @ApiRequestExclude(groups = {Ignore.class})
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    private String baseUri;

    private String category;

    private JSONObject info;

    public KnowledgeGraphDTO toKnowledgeGraph() {
        KnowledgeGraphDTO kg = DozerUtil.mapper(this, KnowledgeGraphDTO.class);
        kg.setInfo(info.toJSONString());
        return kg;
    }
}
